﻿@{
	Layout = null;
}

<!DOCTYPE html>

<html>
<head>
	<meta name="viewport" content="width=device-width" />
	<title>Demo01</title>
	<style type="text/css">
		div, table, tr, td {
			margin: 0px;
			padding: 0px;
		}

		.myTable {
			Width: 800px;
			margin: 20px auto;
			border-collapse: collapse;
		}

			.myTable td {
				height: 30px;
				line-height: 30px;
				padding: 6px;
			}
	</style>
	<script src="~/Js/jquery-1.10.2.js"></script>
	<script type="text/javascript">
		$(function(){
			$("#btAdd").click(function(){
						var strCheck="";
						$("input:checkbox[name=ckHobby]:checked").each											(function(){																	if(strCheck!="")
										strCheck+=",";
										strCheck+=$(this).val();
											})
						$("#Hobby").val(strCheck);
										})
					})
	</script>
</head>
<body>
	<form method="post" action="~/Chp07/Demo01Show">
		<div style="text-align:center">
			<table width="800" class="myTable" border="1">
				<tr>
					<td colspan="2" align="center" style="font-weight:bold">员工新增</td>
				</tr>
				<tr>
					<td width="200" align="right">所属部门：</td>
					<td width="600" align="left">
						<select name="DeptName" id="DeptName">
							<option value="请选择">--请选择--</option>
							<option value="总经办">总经办</option>
							<option value="行政部">行政部</option>
							<option value="市场部">市场部</option>
							<option value="技术部">技术部</option>
						</select>
					</td>
				</tr>
				<tr>
					<td width="200" align="right">员工姓名：</td>
					<td width="600" align="left"><input type="text" name="RealName" /></td>
				</tr>
				<tr>
					<td width="200" align="right">员工电话：</td>
					<td width="600" align="left"><input type="text" name="Phone" /></td>
				</tr>
				<tr>
					<td width="200" align="right">性别：</td>
					<td width="600" align="left">
						<input type="radio" name="Sex" id="boy" value="男" />男
						<input type="radio" name="Sex" id="gril" value="女" />女
					</td>
				</tr>
				<tr>
					<td width="200" align="right">爱好：</td>
					<td width="600" align="left">
						<input type="checkbox" name="ckHobby" value="抽烟" />抽烟
						<input type="checkbox" name="ckHobby" value="喝酒" />喝酒
						<input type="checkbox" name="ckHobby" value="烫头" />烫头
						<input type="checkbox" name="ckHobby" value="打游戏" />打游戏
						<input type="hidden" id="Hobby" name="Hobby" />

					</td>
				</tr>
				<tr>
					<td width="200" align="right"></td>
					<td width="600" align="left">
						<input id="btAdd" type="submit" value="新增员工" />
					</td>

				</tr>
			</table>
		</div>
	</form>
</body>
</html>
